class HomeController < ApplicationController
  # allows the homepage to work
  def index
    if current_user  # authenticate user
      # need to create an order in case a user tried to create order
      @order  = Order.new;
      # extra macros to let the home page work
      @my_orders = User.find(session[:user_id]).orders 
      @my_deliveries = Order.find_all_by_driver_id(current_user.id)
    end
  end

end
